package net.starwifi.duobao.service;

import net.starwifi.duobao.dto.DBTimesStockResult;
import net.starwifi.duobao.entity.DBOrder;
import net.starwifi.duobao.entity.DBTimes;
import net.starwifi.duobao.mvc.PageView;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2015/11/19.
 */
public interface DBTimesService extends BaseService<DBTimes,Long> {

    /** 创建夺宝期 */
    DBTimes create(DBTimes dbTimes);

    /** 查找夺宝期*/
    DBTimes findByTimesNo(String timeNo);

    /** 分配库存 */
    DBTimesStockResult lockStock(DBOrder dbOrder);

    /** 分配一个夺宝号*/
     String getTimesCode(String timesNo);

    /** 分配多个夺宝号*/
     List<String> getTimesCodeList(String timesNo,int size);

     void returnTimesPool(String timesNo,List<Integer> data);

    /** 生成夺宝池 */
     void createTimesPool(String timesNo,Integer size);

    /** 获取当前进度缓存 */
     Integer getCQ(String id);

     Map<Long,Integer> getCQS(String q);


     void findLottery(final DBTimes dbTimes);

     /* 夺宝期夺宝号库存*/
     Long getPoolSize(String timesNo);

     void updateWantOrder(Long timesId,Long orderId);

    String exportExcel2003WithUsermodel(String format, String realPath, PageView pageView);
}
